<%--
  Created by IntelliJ IDEA.
  User: joker
  Date: 2023/5/17
  Time: 8:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>CoolMeeting会议管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/styles/common.css"/>
    <script src="${pageContext.request.contextPath}/js/node_modules/jquery/dist/jquery.js"></script>
</head>
<body>
<div class="page-header">
    <div class="header-banner">
        <img src="${pageContext.request.contextPath}/images/header.png">
    </div>
    <div class="header-title">
        欢迎访问Cool-Meeting会议管理系统
    </div>
</div>
<div class="page-body">
    <div class="page-content">
        <div class="content-nav">
        </div>
        <form method="post" action="adminChangePassword.do" >
            <fieldset>
                <legend>管理员密码修改</legend>
                <table class="formtable" style="width:50%">
                    <tr>
                        <td>新密码:</td>
                        <td>
                            <input type="password" name="password" id="password" maxlength="20" placeholder="请输入新密码" required/>
                        </td>
                    </tr>
                    <tr>
                        <td>确认密码:</td>
                        <td>
                            <input type="password" name="confirm" id="confirm" maxlength="20" required/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="command">
                            <input type="submit" value="修改"  />
                            <input type="reset" value="重置"  />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </div>
</div>
<div class="page-footer">
    <hr/>
    更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a>
    <img src="${pageContext.request.contextPath}/images/footer.png" alt="CoolMeeting"/>
</div>
<script>
    const form = document.querySelector('form');
    form.addEventListener('submit',(event)=>{
        event.preventDefault();
        const password = form.elements.password.value;
        const confirm = form.elements.confirm.value;
        if (password === confirm){
            alert("密码修改成功！！！");
            form.submit();
        }else {
            alert("请确认您输入的密码正确！！！");
            form.reset();
        }
    });

</script>
</body>
</html>

